import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    mode: "history", /*去除网址里的#号*/
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/pages/Home.vue'),
            meta: {title: '主页'},
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/pages/Dashboard'),
                    meta: {title: '系统首页'}
                },
                {
                    path: '/studentInfo',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/Student'),
                    meta: {title: '学生信息'}
                },
                {
                    path: '/teacherInfo',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/Teacher'),
                    meta: {title: '教师信息'}
                },
                {
                    path: '/gradeInfo',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/Grade'),
                    meta: {title: '成绩信息'}
                },
                {
                    path: '/courseInfo',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/CourseSelect'),
                    meta: {title: '选课信息'}
                },
                {
                    path: '/teachInfo',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/Teach'),
                    meta: {title: '课程信息'}
                },
                {
                    path: '/allCourses',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/CourseInfo'),
                    meta: {title: '所有课程'}
                },
                {
                    path: '/updateCourses',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/CourseUpdate'),
                    meta: {title: '课程管理'}
                },
                {
                    path: '/courseDetail',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/CourseDetail'),
                    meta: {title: '课程详情'}
                },
                {
                    path: '/rankInfo',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/Rank'),
                    meta: {title: '排名信息'}
                },
                {
                    path: '/gradeInfo',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/Grade'),
                    meta: {title: '成绩信息'}
                },
                {
                    path: '/courseSelectUpdate',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/CourseSelectUpdate'),
                    meta: {title: '选课管理'}
                },
                {
                    path: '/scoreInsert',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/TeachScore'),
                    meta: {title: '成绩录入'}
                },
                {
                    path: '/studentAnalyse',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/studentDash'),
                    meta: {title: '学生学业情况分析'}
                },
                {
                    path: '/gradeInsert',
                    component: () => import(/* webpackChunkName: "problemset" */ '../components/pages/GradeUpdate'),
                    meta: {title: '批量录入'}
                },
                {
                    path: '/about',
                    component: () => import(/* webpackChunkName: "markdown" */ '../components/pages/About'),
                    meta: {title: '关于我们'}
                },
                {
                    path: '/message',
                    component: () => import(/* webpackChunkName: "markdown" */ '../components/pages/Message'),
                    meta: {title: '消息通知'}
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/pages/Login'),
            meta: {title: '登录'}
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
